package model
{
	import mx.collections.ArrayCollection;

	[Bindable]
	public class Slide
	{
		public var projectWidth:int = 800;
		
		public var projectHeight:int = 600;
		
		public var slides:ArrayCollection;
		
		public function Slide()
		{
		}
		
		public function add(newPage:SlidePage):void {
			slides.addItem(newPage);
		}
		
		public function addPageAtPlace(newPage:SlidePage, place:int):void {
			if(slides.length>place) {
				slides.addItemAt(newPage, place);
			} else {
				slides.addItem(newPage);
			}
		}
		
		public function movePageTo(page:SlidePage, place:int):void {
			removePage(page);
			addPageAtPlace(page, place);
		}
		
		public function removePage(page:SlidePage):void {
			slides.removeItemAt(slides.getItemIndex(page));
		}
	}
}